package com.power.using.mydaggerp.model.movie;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.api.DoubanApi;
import com.power.using.mydaggerp.base.BaseModel;
import com.power.using.mydaggerp.contract.movie.MovieMainContract;
import com.power.using.mydaggerp.model.bean.douban.movie.HotMovieBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/16.
 * Time: 2019/10/16  15:14
 */
public class MovieMainModel extends BaseModel implements MovieMainContract.IMovieMainModel{

    @NonNull
    public static MovieMainModel newInstance() {
        return new MovieMainModel();
    }


    @Override
    public Observable<HotMovieBean> getHotMovieList() {
        return RetrofitCreateHelper.createApi(DoubanApi.class,DoubanApi.HOST)
                .getHotMovie()
                .compose(RxHelper.<HotMovieBean>rxSchedulerHelper());
    }
}
